package com.chinasoft.order.mapper;

import com.chinasoft.order.domain.Order;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

public interface OrderMapper {


    @Select("select * from orders where status = 0")
    List<Order> findAll();



    //接订单
    @Update("update orders set rid = #{arg0},status = 1 where id = #{arg1}")
    int takeOrder(String rid,Integer id);


    //完成订单
    @Update("update orders set arrive_time = #{arriveTime},status = 2 where id = #{id}")
    int doneOrder(String id, Date arriveTime);
}
